<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Index extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->helper('url');
        $this->load->helper('get_rss');


    }

    public function _remap($method, $params=array()) {
        if ($this->session->userdata('email')) {
            if (method_exists($this, $method)) {
                return call_user_func_array(array($this, $method), $params);
            }
            show_404();
        } else {
            $data['message'] = 'Vui lòng đăng nhập';
            $this->load->view('header');
            $this->load->view('login', $data);
            $this->load->view('footer');
        }
    }

    public function index() {
        $this->load->helper('tasks');
        $data['task_module'] =task_display($this);
        $data['access_token'] = json_decode($this->session->userdata['token']);
        $data['email_module'] = getEmail( $data['access_token']->access_token);
        $this->load->view('index', $data);

    }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */